﻿#include "MyArray.h"
#include <iostream>

int main() {
	MyArray arr1(3); 
	arr1.setElement(0, 10);
	arr1.setElement(1, 20);
	arr1.setElement(2, 30);

	MyArray arr2 = arr1; 
	std::cout << "arr2 大小: " << arr2.getSize() << ", arr2[1]: " << arr2.getElement(1) << std::endl;

	MyArray arr3(2);
	arr3.setElement(0, 40);
	arr3.setElement(1, 50);
	MyArray merged = arr1.merge(arr3);
	std::cout << "合并后大小: " << merged.getSize() << ", merged[2]: " << merged.getElement(2) << std::endl;

	MyArray arr4(3);
	arr4.setElement(0, 5);
	arr4.setElement(1, 5);
	arr4.setElement(2, 5);

	MyArray addResult = arr1.add(arr4);
	std::cout << "加法结果[0]: " << addResult.getElement(0) << std::endl;

	MyArray subResult = arr1.subtract(arr4);
	std::cout << "减法结果[1]: " << subResult.getElement(1) << std::endl;

	MyArray mulResult = arr1.multiply(arr4);
	std::cout << "乘法结果[2]: " << mulResult.getElement(2) << std::endl;

	MyArray divResult = arr1.divide(arr4);
	std::cout << "除法结果[0]: " << divResult.getElement(0) << std::endl;

	return 0;
}